package com.ruyuan.seckilling.render.service.impl;

import com.ruyuan.seckilling.render.entity.PageLog;
import com.ruyuan.seckilling.render.mapper.PageLogMapper;
import com.ruyuan.seckilling.render.service.PageLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zhonghuashishan
 */
@Service
public class PageLogServiceImpl implements PageLogService {

    @Autowired
    private PageLogMapper pageLogMapper;

    @Override
    public PageLog queryById(Long id) {
        return pageLogMapper.selectById(id);
    }

    @Override
    public void save(PageLog pageLog) {
        pageLogMapper.insert(pageLog);
    }

    @Override
    public void updataFinishedServerIps(Long id, String finishedServerIps) {
        PageLog pageLog = PageLog.builder().id(id).finishedServerIps(finishedServerIps).build();
        pageLogMapper.updateById(pageLog);
    }
}
